regs->eflags |= X86_EFLAGS_IF;
/* No fast trap at start of day. */
- p->thread.fast_trap_idx = 0x20;
- p->thread.fast_trap_desc.a = 0;
- p->thread.fast_trap_desc.b = 0;
+ SET_DEFAULT_FAST_TRAP(&p->thread);
}
idle->thread.esp = idle->thread.esp0 = (unsigned long)idle + THREAD_SIZE;
idle->thread.eip = (unsigned long) start_secondary;
+ SET_DEFAULT_FAST_TRAP(&idle->thread);
+
/* start_eip had better be page-aligned! */
start_eip = setup_trampoline();
if ( idx == 0 )
{
CLEAR_FAST_TRAP(¤t->thread);
- memset(idt_table+current->thread.fast_trap_idx, 0, 8);
- current->thread.fast_trap_idx = 0x20;
- current->thread.fast_trap_desc.a = 0;
- current->thread.fast_trap_desc.b = 0;
+ SET_DEFAULT_FAST_TRAP(¤t->thread);
return 0;
}
trap_info_t traps[256];
};
+#define SET_DEFAULT_FAST_TRAP(_p) \
+ (_p)->fast_trap_idx = 0x20; \
+ (_p)->fast_trap_desc.a = 0; \
+ (_p)->fast_trap_desc.b = 0;
+
#define CLEAR_FAST_TRAP(_p) \
(memset(idt_table + (_p)->fast_trap_idx, 0, 8))
+
#define SET_FAST_TRAP(_p) \
(memcpy(idt_table + (_p)->fast_trap_idx, &((_p)->fast_trap_desc), 8))
{ [0 ... 7] = 0 }, /* debugging registers */ \
0, 0, 0, \
{ { 0, }, }, /* 387 state */ \
- 0, { 0, 0 }, \
+ 0x20, { 0, 0 }, /* DEFAULT_FAST_TRAP */ \
{ {0} } /* io permissions */ \
}